import App from './App'

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
import uviewPlus from '@/uni_modules/uview-plus'
import mpShare from '@/uni_modules/uview-plus/libs/mixin/mpShare'

uni.$u.config.unit = 'px'

//
import cuCustom from './components/cu-custom'

import i18n from '@/lang/index'

import util from '@/utils/utils.js'
import store from './store'
import '@/utils/request'
import api from '@/api/index.js';
import socketIO from '@/common/socket.js';
import zhouWeiNavBar from "@/components/zhouWei-navBar/index.vue";
import subTabnav from "@/components/sub/tabnav.vue";

import Empty from "@/components/Empty.vue" //通用空状态
import Tags from "@/components/Tags.vue" //通用标签

import { setupMixin } from './mixins'


export function createApp() {
	const app = createSSRApp(App)
	//配置
	app.config.globalProperties.appStatus = true;
	app.config.globalProperties.$util = util;
	app.config.globalProperties.$api = api;
	app.config.globalProperties.$store = store;
	app.config.globalProperties.$url = 'https://lawyer.soft.jx.cn/api/';
	app.config.globalProperties.socketIo = new socketIO()
	app.component('cu-custom', cuCustom)
	app.component("nav-bar", zhouWeiNavBar);
	app.component("sub-tabnav", subTabnav);
	app.component('Empty',Empty)
	app.component('Tags',Tags)
	app.use(uviewPlus,store)
	app.use(i18n)
	app.mixin(mpShare)
	setupMixin(app)
	return {
		app
	}
}
// #endif